<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>{$title|default='微信进件管理后台'}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="/static/layui/css/layui.css">
    <link rel="stylesheet" href="/static/admin/css/admin.css">
    <style>
        .layui-layout-admin .layui-header {
            background-color: #393D49;
        }
        .layui-layout-admin .layui-logo {
            color: #fff;
            font-size: 18px;
        }
        .layui-side {
            top: 60px;
        }
        .layui-body {
            top: 60px;
            left: 200px;
        }
        .layui-footer {
            left: 200px;
        }
        .admin-nav-tree .layui-nav-item a {
            color: #fff;
        }
        .admin-nav-tree .layui-nav-item a:hover {
            background-color: #4E5465;
        }
        .admin-nav-tree .layui-this a {
            background-color: #009688 !important;
        }
    </style>
</head>
<body class="layui-layout-body">
    <div class="layui-layout layui-layout-admin">
        <!-- 头部 -->
        <div class="layui-header">
            <div class="layui-logo">微信进件管理后台</div>
            <ul class="layui-nav layui-layout-right">
                <li class="layui-nav-item">
                    <a href="javascript:;">
                        <i class="layui-icon layui-icon-user"></i>
                        {$admin_user.nickname|default=$admin_user.username}
                    </a>
                    <dl class="layui-nav-child">
                        <dd><a href="/admin/setting/profile">个人设置</a></dd>
                        <dd><a href="/admin/logout">退出登录</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
        
        <!-- 侧边栏 -->
        <div class="layui-side layui-bg-black">
            <div class="layui-side-scroll">
                <ul class="layui-nav layui-nav-tree admin-nav-tree" lay-filter="nav">
                    <li class="layui-nav-item {if condition='$Think.request.controller eq Dashboard'}layui-this{/if}">
                        <a href="/admin/dashboard">
                            <i class="layui-icon layui-icon-home"></i>
                            <span>仪表板</span>
                        </a>
                    </li>
                    <li class="layui-nav-item {if condition='$Think.request.controller eq Merchant'}layui-this{/if}">
                        <a href="javascript:;">
                            <i class="layui-icon layui-icon-shop"></i>
                            <span>商户管理</span>
                        </a>
                        <dl class="layui-nav-child">
                            <dd><a href="/admin/merchant">商户列表</a></dd>
                            <dd><a href="/admin/merchant?status=pending">待审核</a></dd>
                            <dd><a href="/admin/merchant?status=approved">已通过</a></dd>
                            <dd><a href="/admin/merchant?status=rejected">已拒绝</a></dd>
                        </dl>
                    </li>
                    <li class="layui-nav-item {if condition='$Think.request.controller eq User'}layui-this{/if}">
                        <a href="/admin/user">
                            <i class="layui-icon layui-icon-user"></i>
                            <span>用户管理</span>
                        </a>
                    </li>
                    <li class="layui-nav-item {if condition='$Think.request.controller eq AdminUser'}layui-this{/if}">
                        <a href="/admin/admin">
                            <i class="layui-icon layui-icon-username"></i>
                            <span>管理员</span>
                        </a>
                    </li>
                    <li class="layui-nav-item">
                        <a href="javascript:;">
                            <i class="layui-icon layui-icon-set"></i>
                            <span>系统管理</span>
                        </a>
                        <dl class="layui-nav-child">
                            <dd><a href="/admin/setting">系统设置</a></dd>
                            <dd><a href="/admin/log">操作日志</a></dd>
                            <dd><a href="/admin/setting/cache">缓存管理</a></dd>
                        </dl>
                    </li>
                </ul>
            </div>
        </div>
        
        <!-- 内容主体 -->
        <div class="layui-body">
            <div class="layui-fluid" style="padding: 15px;">
                {__CONTENT__}
            </div>
        </div>
        
        <!-- 底部 -->
        <div class="layui-footer">
            <p style="text-align: center; color: #666; margin: 10px 0;">
                © 2024 微信进件管理系统 - Powered by ThinkPHP6
            </p>
        </div>
    </div>
    
    <script src="/static/layui/layui.js"></script>
    <script>
        layui.use(['element', 'layer'], function(){
            var element = layui.element;
            var layer = layui.layer;
            
            // 监听导航点击
            element.on('nav(nav)', function(elem){
                // 可以在这里添加导航点击的处理逻辑
            });
        });
        
        // 全局AJAX设置
        layui.use('jquery', function(){
            var $ = layui.jquery;
            
            // 设置CSRF token（如果需要）
            $.ajaxSetup({
                headers: {
                    'X-Requested-With': 'XMLHttpRequest'
                }
            });
        });
    </script>
    
    {block name="script"}{/block}
</body>
</html>
